#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>


int main()
{
    
    printf("我的pid是:%d\n",getpid());
    pid_t id = fork();

    if(id==0)
    {
        int count =5;
        while(count)
        {
            printf("我是子进程. 运行中...  %d\n",count);
            count--;
            sleep(1);
        }
    }   

    else
    {
        while(1)
        {
            printf("我是父进程. 运行中...  \n");
            sleep(2);
        }
    }
    
    return 0;
}
